package reflect;

import java.util.ArrayList;

public class ReflectDemo2 {
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {

      /*
      使用反射机制实列化对象
      1.获取需要实例化对象的类
       */

       // Class cls= ArrayList.class;
        Class cls=Class.forName("java.util.ArrayList");

        Object obj=cls.newInstance();
        System.out.println(obj);


    }
}
